<?php
global $_GPC, $_W;
$GLOBALS['frames'] = $this->getMainMenu();
$where = '1=1';
if($_GPC['keywords']){
	
	$op=$_GPC['keywords'];
	$where .=" and u.name LIKE {%$op%}";	
}

	/*	$sql="select *  from " . tablename("cjdc_user") ." WHERE  name LIKE :name  and uniacid=:uniacid";
	$list=pdo_fetchall($sql,array(':name'=>$where,'uniacid'=>$_W['uniacid']));*/
	$pageindex = max(1, intval($_GPC['page']));
	$pagesize=10;
	$sql="select uc.*,u.name as username,u.img  from " . tablename("cjdc_user_feedback") ." as uc left join " . tablename('cjdc_user'). " as u on u.id=uc.uid WHERE  ".$where." and uc.uniacid=:uniacid and uc.store_id=0";
	$select_sql =$sql." LIMIT " .($pageindex - 1) * $pagesize.",".$pagesize;

	$list = pdo_fetchall($select_sql,array(':uniacid'=>$_W['uniacid']));	   
	$total=pdo_fetchcolumn("select count(*)  from " . tablename("cjdc_user_feedback") ." as uc left join " . tablename('cjdc_user'). " as u on u.id=uc.uid WHERE  ".$where." and uc.uniacid=:uniacid and uc.store_id=0",array(':uniacid'=>$_W['uniacid']));
	$pager = pagination($total, $pageindex, $pagesize);
	if($_GPC['id']){
		$res4=pdo_delete("cjdc_user_feedback",array('id'=>$_GPC['id']));
		if($res4){
		 message('删除成功！', $this->createWebUrl('feedback'), 'success');
		}else{
			  message('删除失败！','','error');
		}
	}
include $this->template('web/feedback');